<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>个股详情</title>
		<link href="css/text.css" rel="stylesheet" type="text/css" />
		<style type="text/css">				
			p {margin:3px}
			ul {margin:1px}			
			h4 {margin:0px}				
			.fixedBox{
				border: 1px solid #555555;			
				white-space: nowrap;	
			}
			.fixedBox::-webkit-scrollbar {
				width: 10px;     
				height: 10px;				
			}			
		</style>
	</head>
	<body>					
		<div id="towrite" class="fixedBox"></div>			
		<script type="text/javascript" src="js/json2html.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script>
			var bkcolor = $("body").css("backgroundColor");
			var ztxq = 0;  //默认显示涨停原因(0:不显示；1:显示)
			var sdxq = 0;  //默认显示同花顺速递(0:不显示；1:显示)
			var rdxq = 0;  //默认显示东财热点(0:不显示；1:显示)
			
			var dt = "";
			var tt = "";
			var gt = "";			
			window.onload = function() {
				var day = new Date();
				gt = day.getTime();
				tt = day.getFullYear() + "-" + (day.getMonth()+1) + "-" + day.getDate();
				dt = tt;
				getSource();
				changeStyle();
			}
			
			
			document.ondblclick = function () {
				var u = decodeURI(window.location.href);				
				gp = u.split('##');					
				gpdm = gp[1];
				gpmc = gp[2];				
				var i = "http://www.treeid/dlglocalurl##homepath##company/%E4%B8%AA%E8%82%A1%E8%AF%A6%E6%83%85(%E8%B5%84%E9%87%91%E6%B5%81).html##" + gpdm + "##" + encodeURI(gpmc);
				window.open(i, "_parent");
			}
					
					
			var z = "1";
			$(function() {
				setInterval(function() {
					if(z == "1"){					
						getSource();										
					}					
				},
				1000);
			})
			
			function time_range(beginTime, endTime) {
				var strb = beginTime.split(":");
				if (strb.length != 2) {
					return false;
				}

				var stre = endTime.split(":");
				if (stre.length != 2) {
					return false;
				}

				var b = new Date();
				var e = new Date();
				var n = new Date();

				b.setHours(strb[0]);
				b.setMinutes(strb[1]);
				e.setHours(stre[0]);
				e.setMinutes(stre[1]);

				if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
					hqsx();					
					console.log(true)　　　　　　
					return true;				
				} else {
					console.log(false)
				    return false;     
				}
			}　　　
			
			//同股状态下刷新
			$(function() {
				setInterval(function() {
					if(z == "1" && k == 0){	
						time_range("9:00","15:15")																					
					}					
				},
				60000);
			})
			
			var ds = 0;
			function hqsx() {
				ds = 1;
			}
			
			function changeStyle() {
				var obj = document.getElementById("towrite");								
				obj.style.left= "0px"; 
				obj.style.width= "95%";								
				obj.style.fontSize="12px";				
			}			
			
			function changeCss(obj,id){				
				var alist = document.getElementById(id).getElementsByTagName("a");					
				for(var i = 0; i < alist.length; i++){				
					if(alist[i] == undefined){
						break;
					}
					alist[i].style.color = "#E5E5E5"; //给所有a标签赋原色
				}
				obj.style.color = "#00FFFF"; //令当前标签高亮				
			}
				
			var k = 0;
			var gpdm = "";
			var gpmc = "";				
			function getSource() {
				var div = document.getElementById('towrite');
				var u = decodeURI(window.location.href);								
				if(u.indexOf("##") > -1){
					var gp = u.split('##');				
					dm = gp[1];
					gpmc = gp[2];					
					//alert(dm);
					if(dm == gpdm){
						k = 0;
					}else{
						k = 1;
						q = 0;	
						q1 = 0;
						q2 = 0;
						q3 = 0;
					}				
				}else{
					dm = "600000";
					gpmc = "浦发银行";
					k = 1;					
				}
				
				if(dm != gpdm){	
					gpdm = dm;
					
					div = document.getElementById('towrite');
					var sx = "<a style='float:right; padding-right:30px;color:#E1FFFF;'  href='javascript:void(0)' id='sx' onclick='updatex()'>停止刷新</a>";														
					
					if(k == 1 || ds == 1){
						gpdm = dm;
						if(q1 + q2 + q3 == 0){
							writeSource1();   //涨停原因
						}
						ds = 0;	
						//div.innerHTML += '<p style="font-size:14px;">' + gpdm + "&nbsp;&nbsp;" + gpmc + sx + '</p>';	
						setTimeout(function(){
							var url1 = "http://127.0.0.1:8880/w1/api/index.php?a=GetFeaturedSection&c=StockL2Data&apiv=w26&StockID=" + gpdm;	
							var res1 = [];
							$.ajax({
								type: "get",
								url: url1,
								dataType: "json",
								async : false,
								cache:false,
								timeout:3000,					
								success: function(data) {
									//alert(JSON.stringify(data))						
									//document.write(JSON.stringify(data));															
									<!-- for (var i = 0; i < data.info.length; i++){ -->
										<!-- var aa = data.info[i] ; -->
										<!-- res.push({"code":aa[0],"name":aa[1],"zf":aa[2]});							 -->
									<!-- } -->
									res1 = data.info;
								}
							});
							
							
							var url2 = "https://apparticle.longhuvip.com/w1/api/index.php?a=GetConceptJXBKw23&apiv=w24&c=StockF10Basic&StockID=" + gpdm;
							var res2 = [];
							$.ajax({
								type: "get",
								url: url2,
								dataType: "json",
								async : false,
								cache:false,
								timeout:3000,					
								success: function(data) {
									//alert(JSON.stringify(data))						
									//document.write(JSON.stringify(data));							
									res2 = data.List;
								}
							});
							//document.write("<br><br>");
											
							var res = [];
							for (var i = 0; i < res1.length; i++){
								var aa = res1[i] ;
								res.push({"code":aa[0],"name":aa[1],"zf":aa[2]});							
							}
							for (var i = 0; i < res2.length; i++){
								var aa = res2[i];
								var code = aa.CCode;
								var a = res.findIndex((v) => {  //(findIndex)判断数组有无指定对象   
									return v.code ===  code;
								});
								if(a == -1){
									res.push({"code":code,"name":aa.CName,"zf":null});
								}												
							}
							//document.write(JSON.stringify(res));
							
							//添加分类Div
							var newDiv = document.createElement("div");
							newDiv.id = "jxbk";	
							newDiv.style.border = "1px solid #808080";
							newDiv.style.marginLeft = "0px";
							document.getElementById("towrite").appendChild(newDiv);
							var div1 = document.getElementById('jxbk');
							
							for (var i = 0; i < res.length; i++){
								var code = res[i].code;						
								var name = res[i].name;
								var zf = res[i].zf;
								var zfs = "";
								if(zf != null){
									zfs = "&nbsp;涨幅：" + zf + "%";
								}		
								var bks = "<a href='javascript:void(0)' id='" + name + "' onclick='changeCss(this,\"towrite\");update(" + "\"" +
											code + "\"+\"#\"+" + "\"" + name + "\"" + ")'>" + ( i + 1) + "、" +
											 "&nbsp;" + name + zfs + "</a>"	;									 
								var jx = "<td><a href='javascript:void(0)' style='float:right;' onclick='updatexq(888" + code + ")'>" + "详情" + "</a></td>";						
								
								var a = res2.findIndex((v) => {  //(findIndex)判断数组有无指定对象   
									return v.CCode ===  code;
								});
								var xq = "";
								if(a > -1){
									var arrfind = res2.find(function (item) {
										return item.CCode == code
									});
									xq = arrfind.Analysis; 
									if(xq == ""){
										xq = "暂无";
									}
								}else{
									xq = "暂无";
								}	
								
								div1.innerHTML += "<p style='margin-left:0px;'>" + bks + jx + "</p>";	
								
								//添加详情
								var newDiv = document.createElement("div");
								newDiv.id = "888" + code;
								newDiv.style.display = "none";
								newDiv.style.whiteSpace = "normal";
								div1.appendChild(newDiv);
								
								var div2 = document.getElementById("888" + code);
								div2.innerHTML = xq;	
								
								var bkdm = code;	
								//添加板块个股
								var newDiv1 = document.createElement("div");
								newDiv1.id = bkdm;
								newDiv1.style.display = "none";
								document.getElementById("jxbk").appendChild(newDiv1);
								temp = "";		
							}
							
							//变色
							var interval = setInterval(function() {
								if(yy != ""){	
									ranking();							
									clearInterval(interval);							
								}					
							},100);	
							
							$("#bt").text('');
						}, 100);
					}					
				}
			}
			
			var yy = "";			
			function writeSource1() { 
				var div = document.getElementById('towrite');
				var sx = "<a style='float:right'  href='javascript:void(0)' id='sx' onclick='updatex()'>停止刷新</a>";	
				var yt = '<font id="bt" size="1" style="padding-left:10px;color:#FFFF00;"></font>'
				var title = "涨停原因：";
				div.innerHTML = '<b style="font-size:14px;">个股详情：' + gpdm + "&nbsp;&nbsp;&nbsp;" + gpmc + yt + sx + '</b>';
				if(k == 1){
					$("#bt").text('载入……');
				}
				var url11 = "http://127.0.0.1:8880/w1/api/index.php?a=GetKLineZhangTing&apiv=w26&c=StockLineData&StockID=" + gpdm; 														
				var url12 = "http://127.0.0.1:8881/w1/api/index.php?a=GetDayZhangTing&st=1&apiv=w26&c=HisLimitResumption&StockID=" + gpdm;
				var res1 = [];
				$.ajax({
					type: "get",
					url: url11,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res1 = data.List;
					}
				});
				
				var data2 = "";
				var res2 = [];
				$.ajax({
					type: "get",
					url: url12,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res2 = data.List;						
					}
				});
				
				//document.write(data1);	
				//document.write("<br><br>"+data2);
				
				//涨停原因
				if(res1.length > 0){
					var data1 = JSON.stringify(res1);
					var PZSCode = res1[0].PZSCode;
					var ZSCode = res1[0].ZSCode;					
					yy = GetZtyy(PZSCode,ZSCode);
					
					title = "涨停原因：";
					if(res1[0].Type == 1){
						title = "大涨原因：";
					}
					
					var ztyy = "";
					var transform_aa = [           
						{"tag":"ul", children:function(){return(json2html.transform(this, transform_bb));}}
					];									
					var transform_bb=								
					{"tag":"p style='color:#FFE1E1'", children:function(){
						var jx = "<td><a style='color:#FFE1E1; position:absolute; right:0px;' href='javascript:void(0)' onclick='updates()'>" + "详情" + "</a></td>";											
						ztyy = this.GNSM;
						return("<b>" + this.Date + "：" + yy + "&nbsp;&nbsp;&nbsp;&nbsp;" + this.SCLT + jx + "</b>");						
					}};
										
					var html = json2html.transform(data1, transform_aa);										
					div.innerHTML += '<ul><b style="color:#FFE1E1">' + title + '</b></ul>' + html;
					
					//添加分类Div
					var newDiv = document.createElement("div");
					newDiv.id = "xq";
					newDiv.style.display = "none";
					newDiv.style.whiteSpace = "normal";
					div.appendChild(newDiv);
					var div1 = document.getElementById("xq");
					div1.innerHTML += "<p>" + ztyy + "</p>" ;	
					temp1 = "";	
				}
				
				//前次
				if(res1.length == 0 && res2.length > 0){
					var data2 = JSON.stringify(res2);
					yy = res2[0].Reason.split("；")[0];					
					yy = yy.replace("(","（").replace(")","）");
					title = "前次涨停原因：";					
					if(res2[0].Type == 1){
						title = "前次大涨原因：";
					}
					var ztyy = "";
					var transform_aa = [           
						{"tag":"ul", children:function(){return(json2html.transform(this, transform_bb));}}
					];					
					var transform_bb=								
					{"tag":"p style='color:#FFD0E8'", children:function(){
						var jx = "<td><a style='color:#FFD0E8; position:absolute; right:0px;' href='javascript:void(0)' onclick='updates()'>" + "详情" + "</a></td>";											
						ztyy = this.GNSM;
						return("<b>" + this.Date + "：" + yy + "&nbsp;&nbsp;&nbsp;&nbsp;" + this.SCLT + jx + "</b>");						
					}};
										
					var html = json2html.transform(data2, transform_aa);										
					div.innerHTML += '<ul><b style="color:#FFD0E8">' + title + '</b></ul>' + html;
					
					//添加分类Div
					var newDiv = document.createElement("div");
					newDiv.id = "xq";
					newDiv.style.display = "none";
					newDiv.style.whiteSpace = "normal";
					div.appendChild(newDiv);
					var div1 = document.getElementById("xq");
					div1.innerHTML += "<p>" + ztyy + "</p>" ;	
					temp1 = "";	
				}
				
				//同花顺速递
				var sc = "";
				if(gpdm.substr(0 , 1) == "6"){
					sc = "17";
				}else{
					sc = "33";
				}
				var url3 = "https://eq.10jqka.com.cn/stockCourier/api/courier/eventData/" + sc + "/" + gpdm + ".txt";			
				var res3 = [];
				$.ajax({
					type: "get",
					url: url3,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res3 = data.data.events;
					}
				});
				
				
				if(res3.length > 0){						
					function up(a,b){
						var aa = a.ctime;
						var bb = b.ctime;					
						if(a.catename == "涨停分析"){
							aa = 0;
						}
						if(b.catename == "涨停分析"){
							bb = 0;
						}					
						return aa - bb					
					}
					res3.sort(up);
					var data3 = JSON.stringify(res3);
					
					var dq = "<td><a style='position:absolute; right:0px;' href='javascript:void(0)' onclick='updatest()'>" + "详情" + "</a></td>";
					div.innerHTML += "<ul><b>同花顺速递：（" + res3.length + "项）" + dq + "</b></ul>";
					//添加分类Div
					var newDiv3 = document.createElement("div");
					newDiv3.id = "txq";
					newDiv3.style.display = "none";	
					newDiv3.style.whiteSpace = "normal";
					div.appendChild(newDiv3);
					div3 = document.getElementById("txq");
					
					var transform_aa1 = [           
					{"tag":"p", children:function(){return(json2html.transform(this, transform_bb1));}}
					];
											
					var transform_bb1=												
					{"tag":"ul", children:[									
					{"tag": "li style=color:#00FFFF;", "html":function(){
						if(this.catename == "龙虎榜"){							
							var url = "http://www.treeid/dlghttp://page.tdx.com.cn:7615/site/kggx/tk_ygzl_lhb.html?info=xxxxxx&amp;pageId=dpyd&amp;color=0&amp;bkcolor=000000"
							var lhb = "<a href='" + url + "' style='color:#FF00FF;'>" + this.catename + "：" + this.date + "</a>";							
							return(lhb);
						}else{
							return(this.catename + "：" + this.date);
						}
					
					}},
					{"tag": "p", "html": function(){
						if(this.catename == "涨停分析"){
							return(this.title.replace("涨停分析:","<p style=color:#F5FFFA;>").replace("｜","：</p>"));
						}else{
							return(this.content);
						}
					}},						
					{"tag": "p style=color:#FFF5EE;", "html":"${desc}"}, 						
					]};
					
					var html1 = json2html.transform(data3, transform_aa1);	
					div3.innerHTML += html1;
					temp12 = "";
				}
				
				setTimeout(function(){getdcrd()}, 100);  //东财热点 延时执行
				//getdcrd();
				if(ztxq == 1 && ztyy != ""){  //显示涨停原因
					updates();
				}
				if(sdxq == 1){    //显示同花顺速递
					updatest();
				}					
			}	
			
			function GetZtyy(pZSCode,ZSCode) {
				var url1 = "http://127.0.0.1:8880/w1/api/index.php?a=GetFeaturedSection&c=StockL2Data&apiv=w26&StockID=" + gpdm;
				var res1 = [];
				$.ajax({
					type: "get",
					url: url1,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));							
						res1 = data.info;
					}
				});
				var aa = "";
				var bb = "";
				var yy = "";
				if(pZSCode != ""){
					for (var i = 0; i < res1.length; i++) {	
						if(res1[i].indexOf(pZSCode) > -1){
							aa = res1[i][1]
						}
						if(res1[i].indexOf(ZSCode[0]) > -1){
							bb = res1[i][1]
						}
					}
					yy = aa + "（" + bb + "）";
				}else{				
					for (var i = 0; i < ZSCode.length; i++) {	
						for (var j = 0; j < res1.length; j++) {	
							if(res1[j].indexOf(ZSCode[i]) > -1){
								yy += res1[j][1] + "+";
							}
						}						
					}
					yy = yy.substr(0,yy.length - 1);
				}
				return yy;
			}
			
			//东财热点
			function getdcrd() {
				var div = document.getElementById('towrite');
				var url =  "https://vipmoney.eastmoney.com/collectapi/ranking/GubaHotTopicNew?code=" + gpdm;				
				var res = [];
				$.ajax({
					type: "get",
					url: url,
					dataType: "json",
					async : false,
					cache:false,
					timeout:3000,					
					success: function(data) {
						//alert(JSON.stringify(data))						
						//document.write(JSON.stringify(data));
						res = data.re[gpdm]
					}
				});
				
				var rxq = "<td><a style='position:absolute; right:0px;' href='javascript:void(0)' onclick='updaterd()'>" + "详情" + "</a></td>";					
				var dcrd = "";				
				if(res.length > 0){
					dcrd = res[0].name;
					var rdid = res[0].htid;
					dcrd = "<ul><b>东财热点：<font color=#FFD700>" + dcrd + "</font>" + rxq + "</b></ul>";
									
					div.innerHTML += dcrd;
					//添加分类Div
					var newDiv2 = document.createElement("div");
					newDiv2.id = "dcrd";
					newDiv2.style.display = "none";
					newDiv2.style.whiteSpace = "normal";
					div.appendChild(newDiv2);
					var div2 = document.getElementById("dcrd");
					
					var url1 = "http://gubatopic.eastmoney.com/interface/GetData.aspx"; 
					var res1 = [];
					$.ajax({
						type: "post",
						url: url1,
						data : "param=htid=" + rdid + "&path=newtopic/api/Topic/TopicDetailsRead",
						contentType : "application/x-www-form-urlencoded;charset=UTF-8",
						dataType: "json",
						async : false,
						cache:false,
						timeout:3000,					
						success: function(data) {
							//alert(JSON.stringify(data))						
							//document.write(JSON.stringify(data));							
							res1 = data.re;									
						}
					});			
					
					<!-- rds = rds.replace(/\s+/g,"").replace(/<br>/g,"").replace(/[\r|\n]/g,"");						 -->					
					var rdjd = res1.lead;
					div2.innerHTML += "<ul style='margin-left:-5px;'>" + rdjd + "</ul>";					
					temp21 = "";
					if(rdxq == 1){    //显示东财热点
						updaterd();
					}
				}
			}
			
			//东财热点
			var q3 = 0;
			var temp21 = "";					
			function updaterd() {			
				if(document.getElementById("dcrd")){					
					div = document.getElementById("dcrd");
					if(temp21.indexOf("dcrd") == -1){
						temp21 += "dcrd" + ";";
						div.style.display = "block";
						div.style.border="1px solid #999";
						div.style.color = "#FFFFE0";
						q3 = 1;
					}else{
						temp21 = temp21.replace("dcrd" + ";" , "");
						div.style.display = "none";
						q3 = 0;
					}
				}				
			}
			
			//涨停原因
			var q1 = 0;
			var temp1 = "";					
			function updates() {			
				if(document.getElementById("xq")){					
					div1 = document.getElementById("xq");
					if(temp1.indexOf("xq") == -1){
						temp1 += "xq" + ";";
						div1.style.display = "block";
						div1.style.border="1px solid #999";
						div1.style.color = "#FFFFE0";
						q1 = 1;
					}else{
						temp1 = temp1.replace("xq" + ";" , "");
						div1.style.display = "none";
						q1 = 0;
					}
				}					
			}
			
			//同花顺速递
			var q2 = 0;
			var temp12 = "";					
			function updatest() {			
				if(document.getElementById("txq")){					
					div12 = document.getElementById("txq");
					if(temp12.indexOf("txq") == -1){
						temp12 += "txq" + ";";
						div12.style.display = "block";
						div12.style.border="1px solid #999";
						div12.style.color = "#FFFFE0";
						q2 = 1;
					}else{
						temp12 = temp12.replace("txq" + ";" , "");
						div12.style.display = "none";
						q2 = 0;
					}
				}
			}
			
			var temp2 = "";	
			var q = 0;	//是否在查看详情		
			function updatexq(ss) {	
				if(document.getElementById(ss)){
					div2 = document.getElementById(ss);
					if(temp2.indexOf(ss) == -1){
						temp2 += ss + ";";
						div2.style.display = "block";
						div2.style.whiteSpace = "normal";
						div2.style.border="1px solid #999";
						div2.style.color = "#FFFFE0";
					}else{
						temp2 = temp2.replace(ss + ";" , "");
						div2.style.display = "none";
					}
				}
				if(temp2 == ""){  //查看详情时不刷新				
					q = 0;
				}else{
					q = 1;
				}
			}
			
			function updatex() {				
				aObj = document.getElementById('sx');
				if(aObj.innerText == "停止刷新"){
					z = 0;
					aObj.innerText = "自动刷新";
					aObj.style.color = "#ADFF2F";
				}else if(aObj.innerText == "自动刷新"){
					z = 1;
					aObj.innerText = "停止刷新";
					aObj.style.color = "#E5E5E5";					
				}
			}
						
			function updated() {
				z = 0;			
				aObj = document.getElementById('sx');
				if(aObj.innerText == "停止刷新"){					
					aObj.innerText = "自动刷新";
					aObj.style.color = "#ADFF2F";
				}					
			}
			
			function UnUnicode(str) {
				return unescape(str.replace(/\\/g, "%"));
			}
			
			
			var temp = "";
			var dm = "";						
			function update(ss) {				
				if(ss != "0"){
					var dms = ss.split('#');					
					dm = dms[0];					
					if(document.getElementById(dm)){					
						div1 = document.getElementById(dm);
						if(temp.indexOf(dm) == -1){
							temp += dm + ";";
							div1.style.display = "block";							
						}else{
							temp = temp.replace(dm + ";" , "");
							div1.style.display = "none";
						}
					}					
				}
												
				var url = "http://127.0.0.1:8880/w1/api/index.php?Order=1&st=30&a=ZhiShuStockList_W8&c=ZhiShuRanking&PhoneOSNew=1&old=1&apiv=w21&Type=6&DeviceID=6575961a-b25b-3831-aa2b-4a373b51b256&VerSion=5.12.0.0&PlateID=" + dm; 								
				var res = [];
						$.ajax({
							type: "get",
							url: url,
							dataType: "json",
							async : false,
							cache:false,
							timeout:3000,					
							success: function(data) {
								//alert(JSON.stringify(data))						
								//document.write(JSON.stringify(data));															
								for (var i = 0; i < data.list.length; i++){
									var aa = data.list[i] ;
									res.push({"code":aa[0],"name":aa[1],"zf":aa[6],"lz":aa[24],"zl":aa[2],"lb":aa[23],"zt":aa[39]});							
								}
							}
						});
				
				var data = JSON.stringify(res);
				var transform_aa = [           
				{"tag":"p", children:function(){return(json2html.transform(this, transform_bb));}}
				];
				
				var transform_bb= 
				{"tag":"p", children:[
				{"tag":"p", children:[											
				{"tag": "p", "html":"<a href='http://www.treeid/code_${code}'  onclick='changeCss(this,\"" + dm + "\");updated()'>${code}&nbsp;${name}&nbsp;&nbsp;[${zt}]&nbsp;涨幅：${zf}%&nbsp;${lz}&nbsp;${zl}&nbsp;<font color=#FFA500>${lb}</font></a>"}, 
				]}]}; 
				
				
				var html = json2html.transform(data, transform_aa);		
				var div = document.getElementById(dm);
				div.innerHTML += html.replace(/\[\]/g,"");
				div.style.whiteSpace = "nowrap"; 			
			}

			function ranking(){			
				var alist = document.getElementById("towrite").getElementsByTagName("a");				
				for(var i = 0; i < alist.length; i++){
					yy = yy.replace(/ /g,"");
					var bk = alist[i].id;
					var y1 = "";
					var y2 = "";
					if(yy.indexOf("+")>-1){
						y1 = yy.split("+")[0];
						y2 = yy.split("+")[1];
					}else if(yy.indexOf("（")>-1){
						y1 = yy.split("（")[0];
						y2 = yy.split("（")[1].split("）")[0];
					}else{
						y1 = yy;
					}
					
					if(bk != ""){					
						if(y1 == bk || y2 == bk){							
							alist[i].style.color = "#FFA500";
						}
					}					
				}				
			}
		</script>									
	</body>
</html>